{template 'header', 'member'}
<script type="text/javascript">c(1);</script>
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="?mid={$mid}&action=add"><span>添加商品</span></a></td>
{if $_userid}
<td class="tab" id="s3"><a href="?mid={$mid}"><span>已上架<span class="px10">({$nums[3]})</span></span></a></td>
<td class="tab" id="s2"><a href="?mid={$mid}&status=2"><span>审核中<span class="px10">({$nums[2]})</span></span></a></td>
<td class="tab" id="s1"><a href="?mid={$mid}&status=1"><span>未通过<span class="px10">({$nums[1]})</span></span></a></td>
<td class="tab" id="s4"><a href="?mid={$mid}&status=4"><span>已下架<span class="px10">({$nums[4]})</span></span></a></td>
<td class="tab" id="trade"><a href="trade.php"><span>订单管理<span class="px10">({$nums[9]})</span></span></a></td>
<td class="tab" id="type"><a href="javascript:Dwidget('type.php?item=mall', '[商品分类]', 600, 300);"><span>商品分类<span class="px10">({$nums[0]})</span></span></a></td>
<td class="tab" id="express"><a href="express.php"><span>运费模板</span></a></td>
{/if}
</tr>
</table>
</div>
{if $action=='add' || $action=='edit'}
<iframe src="" name="send" id="send" style="display:none;"></iframe>
<form method="post" id="dform" action="?" target="send" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="6" cellspacing="1" class="tb">
{if $status==1 && $action=='edit' && $note}
<tr>
<td class="tl">未通过原因</td>
<td class="tr f_blue">{$note}</td>
</tr>
{/if}
<tr>
<td class="tl"><span class="f_red">*</span> 商品分类</td>
<td class="tr"><div id="catesch"></div>{ajax_category_select('post[catid]', '选择分类', $catid, $moduleid, $DT_TOUCH ? '' : 'size="2" style="height:120px;width:180px;"')}{if !$DT_TOUCH}<br/>{/if}{if $DT[schcate_limit]}<input type="button" value="搜索分类" onclick="schcate({$moduleid});" class="btn"/> {/if}<span id="dcatid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 商品名称</td>
<td class="tr f_gray"><input name="post[title]" type="text" id="title" size="50" value="{$title}"/> （2-30个字）<span id="dtitle" class="f_red"></span></td>
</tr>
{if $action=='add' && $could_color}
<tr>
<td class="tl">标题颜色</td>
<td class="tr">
{dstyle('color')}&nbsp;
设置信息标题颜色需消费 <strong class="f_red">{$MOD[credit_color]}</strong> {$DT[credit_name]}
</td>
</tr>
{/if}
<tr>
<td class="tl"><span class="f_red">*</span> 商品价格</td>
<td class="tr">
<table cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#EFF5FB" align="center">
<td width="90">数量</td>
<td width="90">价格</td>
<td width="90"></td>
<td width="120">数量</td>
<td width="120">价格</td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[step][a1]" type="text" size="10" value="{$a1}" id="a1"/></td>
<td><input name="post[step][p1]" type="text" size="10" value="{$p1}" id="p1" onblur="Dstep();"/></td>
<td></td>
<td id="p_a_1"></td>
<td id="p_p_1"></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[step][a2]" type="text" size="10" value="{$a2}" id="a2"/></td>
<td><input name="post[step][p2]" type="text" size="10" value="{$p2}" id="p2" onblur="Dstep();"/></td>
<td class="jt" onclick="Dstep()">点击预览</td>
<td id="p_a_2"></td>
<td id="p_p_2"></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[step][a3]" type="text" size="10" value="{$a3}" id="a3"/></td>
<td><input name="post[step][p3]" type="text" size="10" value="{$p3}" id="p3" onblur="Dstep();"/></td>
<td></td>
<td id="p_a_3"></td>
<td id="p_p_3"></td>
</tr>
</table>
<span class="f_gray">&nbsp;填写示例：<span class="c_p" title="点击观看" onclick="Dd('a1').value=1;Dd('p1').value=1000;Dd('a2').value=100;Dd('p2').value=900;Dd('a3').value=500;Dd('p3').value=800;Dstep();">阶梯价格</span> / <span class="c_p" title="点击观看" onclick="Dd('a1').value=1;Dd('p1').value=1000;Dd('a2').value=Dd('p2').value=Dd('a3').value=Dd('p3').value='';Dstep();">非阶梯价格</span></span>
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 商品库存</td>
<td class="tr"><input name="post[amount]" type="text" size="10" value="{$amount}" id="amount"/> <input name="post[unit]" type="text" size="2" value="{if $unit}{$unit}{else}件{/if}" id="unit" title="计量单位"/> <span id="damount" class="f_red"></span></td>
</tr>
{if $CP}
<script type="text/javascript">
var property_catid = {$catid};
var property_itemid = {$itemid};
var property_admin = 0;
</script>
<script type="text/javascript" src="{DT_STATIC}file/script/property.js"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
{/if}
<tr>
<td class="tl">商品品牌</td>
<td class="tr"><input name="post[brand]" type="text" size="30" value="{$brand}"/></td>
</tr>
{if $FD}{fields_html('<td class="tl">', '<td class="tr">', $item)}{/if}

<tr>
<td class="tl">商品图片</td>
<td class="tr">
	<input type="hidden" name="post[thumb]" id="thumb" value="{$thumb}"/>
{if $IMVIP || !$MG[uploadpt]}
	<input type="hidden" name="post[thumb1]" id="thumb1" value="{$thumb1}"/>
	<input type="hidden" name="post[thumb2]" id="thumb2" value="{$thumb2}"/>
{/if}
	<table width="360">
	<tr align="center" height="120" class="c_p">
	<td width="120"><img src="{if $thumb}{$thumb}{else}{DT_SKIN}image/waitpic.gif{/if}" width="100" height="100" id="showthumb" title="预览图片" alt="" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb').src, 1);}else{Dalbum('',{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);}"/></td>
{if $IMVIP || !$MG[uploadpt]}
	<td width="120"><img src="{if $thumb1}{$thumb1}{else}{DT_SKIN}image/waitpic.gif{/if}" width="100" height="100" id="showthumb1" title="预览图片" alt="" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb1').src, 1);}else{Dalbum(1,{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb1').value, true);}"/></td>

	<td width="120"><img src="{if $thumb2}{$thumb2}{else}{DT_SKIN}image/waitpic.gif{/if}" width="100" height="100" id="showthumb2" title="预览图片" alt="" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb2').src, 1);}else{Dalbum(2,{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb2').value, true);}"/></td>
{else}
	<td width="120"><a href="grade.php" target="_blank"><img src="{DT_SKIN}image/vippic.gif" width="100" height="100"/></a></td>
	<td width="120"><a href="grade.php" target="_blank"><img src="{DT_SKIN}image/vippic.gif" width="100" height="100"/></a></td>
{/if}
	</tr>
	<tr align="center" class="c_p">
	<td><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_upload.gif" width="12" height="12" title="上传" onclick="Dalbum('',{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_select.gif" width="12" height="12" title="选择" onclick="selAlbum('');"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_delete.gif" width="12" height="12" title="删除" onclick="delAlbum('','wait');"/></td>
{if $IMVIP || !$MG[uploadpt]}
	<td><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_upload.gif" width="12" height="12" title="上传" onclick="Dalbum(1,{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb1').value, true);"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_select.gif" width="12" height="12" title="选择" onclick="selAlbum(1);"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_delete.gif" width="12" height="12" title="删除" onclick="delAlbum(1,'wait');"/></td>
	<td><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_upload.gif" width="12" height="12" title="上传" onclick="Dalbum(2,{$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb2').value, true);"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_select.gif" width="12" height="12" title="选择" onclick="selAlbum(2);"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_delete.gif" width="12" height="12" title="删除" onclick="delAlbum(2,'wait');"/></td>
{else}
	<td onclick="if(confirm('此操作仅限{VIP}会员，是否现在申请？')) Go('grade.php');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_upload.gif" width="12" height="12" title="上传"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_select.gif" width="12" height="12" title="选择"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_delete.gif" width="12" height="12" title="删除"/></td>
	<td onclick="if(confirm('此操作仅限{VIP}会员，是否现在申请？')) Go('grade.php');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_upload.gif" width="12" height="12" title="上传"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_select.gif" width="12" height="12" title="选择"/>&nbsp;&nbsp;<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/img_delete.gif" width="12" height="12" title="删除"/></td>
{/if}
	</tr>
	</table>
	<span id="dthumb" class="f_red"></span>
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 商品详情</td>
<td class="tr f_gray"><textarea name="post[content]" id="content" class="dsn">{$content}</textarea>
{deditor($moduleid, 'content', $group_editor, '100%', 350)}<br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
{if $MOD[swfu] == 1 && DT_EDITOR == 'fckeditor' && !$DT_TOUCH}
{php include DT_ROOT.'/api/swfupload/editor.inc.php';}
{/if}


<tr>
<td class="tl">可选属性</td>
<td class="tr">
<table cellpadding="4" cellspacing="1" bgcolor="#D7D7D7">
<tr bgcolor="#F7F7F7" align="center">
<td>属性名称</td>
<td>属性值</td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[n1]" type="text" size="10" value="{$n1}" id="n1"/></td>
<td><input name="post[v1]" type="text" size="40" value="{$v1}" id="v1"/></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[n2]" type="text" size="10" value="{$n2}" id="n2"/></td>
<td><input name="post[v2]" type="text" size="40" value="{$v2}" id="v2"/></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td><input name="post[n3]" type="text" size="10" value="{$n3}" id="n3"/></td>
<td><input name="post[v3]" type="text" size="40" value="{$v3}" id="v3"/></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td class="f_gray">例如：颜色</td>
<td class="f_gray">例如：红色|蓝色|黑色|白色 多个属性用|分隔</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="tl">运费设置</td>
<td class="tr">
	<table cellpadding="4" cellspacing="1" bgcolor="#D7D7D7">
	<tr bgcolor="#F7F7F7" align="center">
	<td>快递</td>
	<td>默认运费</td>
	<td>增加一件商品增加</td>
	<td>选择模板 | <a href="express.php" class="t" target="_blank">管理模板</a></td>
	</tr>
	<tr bgcolor="#FFFFFF" align="center">
	<td><input name="post[express_name_1]" type="text" id="express_name_1" size="10" value="{$express_name_1}" /></td>
	<td><input name="post[fee_start_1]" type="text" id="fee_start_1" size="5" value="{$fee_start_1}" /></td>
	<td><input name="post[fee_step_1]" type="text" id="fee_step_1" size="5" value="{$fee_step_1}" /></td>
	<td>
	<select name="post[express_1]" id="express_1" onchange="Dexpress(1, this.options[selectedIndex].innerHTML);">
	<option value="0">选择模板</option>
	{loop $EXP $v}
	<option value="{$v[itemid]}"{if $express_1==$v[itemid]} selected{/if}>{$v[title]}[{$v[express]},{$v[fee_start]},{$v[fee_step]},{$v[note]}]</option>
	{/loop}
	</select>
	</td>
	</tr>
	<tr bgcolor="#FFFFFF" align="center">
	<td><input name="post[express_name_2]" type="text" id="express_name_2" size="10" value="{$express_name_2}" /></td>
	<td><input name="post[fee_start_2]" type="text" id="fee_start_2" size="5" value="{$fee_start_2}" /></td>
	<td><input name="post[fee_step_2]" type="text" id="fee_step_2" size="5" value="{$fee_step_2}" /></td>
	<td>
	<select name="post[express_2]" id="express_2" onchange="Dexpress(2, this.options[selectedIndex].innerHTML);">
	<option value="0">选择模板</option>
	{loop $EXP $v}
	<option value="{$v[itemid]}"{if $express_2==$v[itemid]} selected{/if}>{$v[title]}[{$v[express]},{$v[fee_start]},{$v[fee_step]},{$v[note]}]</option>
	{/loop}
	</select>
	</td>
	</tr>
	<tr bgcolor="#FFFFFF" align="center">
	<td><input name="post[express_name_3]" type="text" id="express_name_3" size="10" value="{$express_name_3}" /></td>
	<td><input name="post[fee_start_3]" type="text" id="fee_start_3" size="5" value="{$fee_start_3}" /></td>
	<td><input name="post[fee_step_3]" type="text" id="fee_step_3" size="5" value="{$fee_step_3}" /></td>
	<td>
	<select name="post[express_3]" id="express_3" onchange="Dexpress(3, this.options[selectedIndex].innerHTML);">
	<option value="0">选择模板</option>
	{loop $EXP $v}
	<option value="{$v[itemid]}"{if $express_3==$v[itemid]} selected{/if}>{$v[title]}[{$v[express]},{$v[fee_start]},{$v[fee_step]},{$v[note]}]</option>
	{/loop}
	</select>
	</td>
	</tr>
	</table>
	<span class="f_gray">&nbsp;填写示例：<span class="c_p" title="点击观看" onclick="Nexpress('0.00', '包邮');">包邮</span> / <span class="c_p" title="点击观看" onclick="Nexpress('500.00', '包邮');">满500包邮</span> / <span class="c_p" title="点击观看" onclick="Nexpress('10.00', '快递');">快递10元</span> / <span class="c_p" title="点击观看" onclick="Nexpress('500.00', '包邮');Dd('express_name_2').value = '快递';Dd('fee_start_2').value = '10.00';">快递10元，满500包邮</span></span>
</td>
</tr>
<tr{if !$_userid} style="display:none;"{/if}>
<td class="tl">自定义分类</td>
<td class="tr"><span id="type_box">{$mycatid_select}</span>&nbsp; <a href="javascript:var type_item='mall-{$_userid}',type_name='post[mycatid]',type_default='{$L[type_default]}',type_id={$mycatid},type_interval=setInterval('type_reload()',500);Dwidget('type.php?item=mall', '[商品分类]', 600, 300);" class="t">[管理分类]</a></td>
</tr>
<tr{if !$_userid} style="display:none;"{/if}>
<td class="tl">我的推荐</td>
<td class="tr">
<input type="radio" name="post[elite]" value="1"{if $elite} checked{/if}/> 是
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="post[elite]" value="0"{if !$elite} checked{/if}/> 否
</td>
</tr>
{if $fee_add}
<tr>
<td class="tl">发布此信息需消费</td>
<td class="tr"><span class="f_b f_red">{$fee_add}</span> {$fee_unit}</td>
</tr>
{if $fee_currency == 'money'}
<tr>
<td class="tl">{$DT[money_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_money}{$fee_unit}</span> <a href="charge.php?action=pay" target="_blank" class="t">[充值]</a></td>
</tr>
{else}
<tr>
<td class="tl">{$DT[credit_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_credit}{$fee_unit}</span> <a href="credit.php?action=buy" target="_blank" class="t">[购买]</a></td>
</tr>
{/if}
{/if}
{if $need_password}
<tr>
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'} <span id="dpassword" class="f_red"></span></td>
</tr>
{/if}
{if $need_question}
<tr>
<td class="tl"><span class="f_red">*</span> 验证问题</td>
<td class="tr">{template 'question', 'chip'} <span id="danswer" class="f_red"></span></td>
</tr>
{/if}
{if $need_captcha}
<tr>
<td class="tl"><span class="f_red">*</span> 验证码</td>
<td class="tr">{template 'captcha', 'chip'} <span id="dcaptcha" class="f_red"></span></td>
</tr>
{/if}
{if $action=='add'}
<tr style="display:none;" id="weibo_sync">
<td class="tl">同步主题</td>
<td class="tr" id="weibo_show"></td>
</tr>
{/if}
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 提 交 " class="btn_g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="btn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
{load('clear.js')}
{if $action=='add'}
<script type="text/javascript">s('mid_{$mid}');m('{$action}');</script>
{else}
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{elseif $action=='relate'}
<form method="post" action="?" id="dform">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<td class="tl">关联名称</td>
<td class="tr f_gray"><input type="text" size="20" name="relate_name" id="relate_name" value="{$M[relate_name]}"/>&nbsp;&nbsp; 例如“颜色”、“尺寸”、“型号”等</td>
</tr>
<tr>
<td colspan="2" class="tr">
{loop $lists $k $v}
<div style="width:130px;float:left;">
	<table width="120">
	<tr align="center" height="110" class="c_p">
	<td width="120"><a href="{$MOD[linkurl]}{$v[linkurl]}" target="_blank"><img src="{$v[thumb]}" width="100" height="100" alt=""/></a></td>
	</tr>
	<tr align="center">
	<td>标题 <input type="text" size="8" name="post[{$v[itemid]}][relate_title]" value="{$v[relate_title]}"/></td>
	</tr>
	<tr align="center">
	<td>排序 <input type="text" size="8" name="post[{$v[itemid]}][listorder]" value="{$k}"/></td>
	</tr>
	<tr align="center">
	<td><a href="?mid={$mid}&action=relate_del&itemid={$itemid}&id={$v[itemid]}" onclick="return _delete();" class="t">[移除]</a></td>
	</tr>
	</table>
</div>
{/loop}
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;<input type="submit" name="submit" value="更 新" class="btn_g"/>
&nbsp;<input type="button" value="新增商品" onclick="add();" class="btn"/></td>
</tr>
</table>
</form>
<form method="post" action="?" id="dform_add">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="action" value="relate_add"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="id" id="id" value="0"/>
<input type="hidden" name="relate_name" id="relate_name_add" value=""/>
</form>
<script type="text/javascript">
function add() {
	if(Dd('relate_name').value.length < 2) {
		alert('请填写关联名称');
		Dd('relate_name').focus();
		return;
	}
	Dd('relate_name_add').value = Dd('relate_name').value;
	select_item('{$mid}&username={$M[username]}', 'relate');
}
</script>
<script type="text/javascript">s('mid_{$mid}');m('s3');</script>
{else}
<div class="tt">
<form action="?">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="status" value="{$status}"/>
&nbsp;{category_select('catid', '商品分类', $catid, $moduleid)}&nbsp;
{$mycat_select}&nbsp;
<input type="text" size="30" name="kw" value="{$kw}" title="关键词"/>&nbsp;
{$order_select}&nbsp;
<input type="submit" value=" 搜 索 " class="btn"/>
<input type="button" value=" 重 置 " class="btn" onclick="Go('?mid={$mid}&status={$status}');"/>
<div class="b10"></div>
&nbsp;单价：<input type="text" size="3" name="minprice" value="{$minprice}"/> ~ <input type="text" size="3" name="maxprice" value="{$maxprice}"/>&nbsp;
订单：<input type="text" size="3" name="minorders" value="{$minorders}"/> ~ <input type="text" size="3" name="maxorders" value="{$maxorders}"/>&nbsp;
销量：<input type="text" size="3" name="minsales" value="{$minsales}"/> ~ <input type="text" size="3" name="maxsales" value="{$maxsales}"/>&nbsp;
库存：<input type="text" size="3" name="minamount" value="{$minamount}"/> ~ <input type="text" size="3" name="maxamount" value="{$maxamount}"/>&nbsp;
评论：<input type="text" size="3" name="mincomments" value="{$mincomments}"/> ~ <input type="text" size="3" name="maxcomments" value="{$maxcomments}"/>&nbsp;
</form>
</div>
<div class="ls">
<form method="post">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th width="60">图片</th>
<th>商品</th>
<th>价格</th>
<th>订单</th>
<th>销量</th>
<th>库存</th>
<th>评论</th>
<th>人气</th>
<th width="100">管理</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><input type="checkbox" name="itemid[]" value="{$v[itemid]}"/></td>
<td><a href="javascript:_preview('{$v[thumb]}');"><img src="{if $v[thumb]}{$v[thumb]}{else}{DT_SKIN}image/nopic50.gif{/if}" width="50" class="thumb"/></a></td>
<td align="left" title="{$v[alt]}"><ul><li>&nbsp;{if $v[elite]}<span class="f_red" title="公司主页推荐">[荐]</span> {/if}{if $v[status]>2}<a href="{$v[linkurl]}" target="_blank" class="t">{else}<a href="?mid={$mid}&action=edit&itemid={$v[itemid]}" class="t">{/if}{$v[title]}</a>{if $v[status]==1 && $v[note]} <a href="javascript:" onclick="alert('{$v[note]}');"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/why.gif" title="未通过原因"/></a>{/if}</li><li title="更新时间 {timetodate($v[edittime], 5)} 添加时间 {timetodate($v[addtime], 5)}" class="px11 f_gray">&nbsp;{if $timetype=='add'}{timetodate($v[addtime], 5)}{else}{timetodate($v[edittime], 5)}{/if}</li></ul></td>
<td class="f_price">{$v[price]}</td>
<td class="px11 c_p{if $v[orders]>0} f_blue f_b{/if}" title="查看订单" onclick="Go('trade.php?mallid={$v[itemid]}');">{$v[orders]}</td>
<td class="px11">{$v[sales]}</td>
<td class="px11{if $v[amount]<5} f_red f_b" title="库存不足{/if}">{$v[amount]}</td>
<td class="px11">{$v[comments]}</td>
<td class="px11">{$v[hits]}</td>
<td>
<a href="?mid={$mid}&action=relate&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/child.png" title="关联商品" alt=""/></a>
<a href="?mid={$mid}&action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>
{if $MG[copy]}&nbsp;<a href="?mid={$mid}&action=add&itemid={$v[itemid]}&catid={$v[catid]}"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/new.png" title="复制信息" alt=""/></a>{/if}
{if $MG[delete]}&nbsp;<a href="?mid={$mid}&action=delete&itemid={$v[itemid]}" onclick="return confirm('确定要删除吗？此操作将不可撤销');"><img width="16" height="16" src="{DT_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="删除" alt=""/></a>{/if}
</td>
</tr>
{/loop}
</table>
</div>
{if $MG[delete] || $timetype!='add'}
<div class="btns">
{if $MG[delete]}
<span class="f_r"><input type="submit" value=" 删除选中 " class="btn" onclick="if(confirm('确定要删除选中{$MOD[name]}吗？')){this.form.action='?mid={$mid}&status={$status}&action=delete'}else{return false;}"/></span>
{/if}
{if $status==3}<input type="submit" value=" 批量下架 " class="btn" onclick="this.form.action='?mid={$mid}&status={$status}&action=unsale';"/>&nbsp;{/if}
{if $status==4}<input type="submit" value=" 批量上架 " class="btn" onclick="this.form.action='?mid={$mid}&status={$status}&action=onsale';"/>&nbsp;{/if}
{if $timetype!='add'}
<input type="submit" value=" 刷新选中 " class="btn" onclick="this.form.action='?mid={$mid}&status={$status}&action=refresh';"/>
{if $MOD[credit_refresh]}
刷新一条信息一次需消费 <strong class="f_red">{$MOD[credit_refresh]}</strong> {$DT[credit_name]}，当{$DT[credit_name]}不足时将不可刷新
{/if}
{/if}
</div>
{/if}
</form>
{if $MG[mall_limit] || (!$MG[fee_mode] && $MOD[fee_add])}
<div class="limit">
{if $MG[mall_limit]}
总共可发 <span class="f_b f_red">{$MG[mall_limit]}</span> 条&nbsp;&nbsp;&nbsp;
当前已发 <span class="f_b">{$limit_used}</span> 条&nbsp;&nbsp;&nbsp;
还可以发 <span class="f_b f_blue">{$limit_free}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
{if !$MG[fee_mode] && $MOD[fee_add]}
发布信息收费 <span class="f_b f_red">{$MOD[fee_add]}</span> {if $MOD[fee_currency] == 'money'}{$DT[money_unit]}{else}{$DT[credit_unit]}{/if}/条&nbsp;&nbsp;&nbsp;
可免费发布 <span class="f_b">{if $MG[mall_free_limit]<0}无限{else}{$MG[mall_free_limit]}{/if}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{if $action == 'add' || $action == 'edit'}
<script type="text/javascript">
function _p() {
	if(Dd('tag').value) {
		Ds('reccate');
	}
}
function check() {
	var l;
	var f;

	f = 'catid_1';
	if(Dd(f).value == 0) {
		Dmsg('请选择商品分类', 'catid', 1);
		return false;
	}
	f = 'title';
	l = Dd(f).value.length;
	if(l < 2) {
		Dmsg('商品名称最少2字，当前已输入'+l+'字', f);
		return false;
	}
	f = 'price';
	l = Dd(f).value;
	if(l < 0.1) {
		Dmsg('请填写商品价格', f);
		return false;
	}
	f = 'amount';
	l = Dd(f).value;
	if(l < 1) {
		Dmsg('请填写库存', f);
		return false;
	}
	f = 'thumb';
	l = Dd(f).value.length;
	if(l < 5) {
		Dmsg('请上传第一张商品图片', f, 1);
		return false;
	}
	f = 'content';
	l = FCKLen();
	if(l < 15 || l > 50000) {
		Dmsg('详细说明应为15-50000字，当前已输入'+l+'字', f);
		return false;
	}

	if(Dd('v1').value) {
		if(!Dd('n1').value) {
			alert('请填写属性名称');
			Dd('n1').focus();
			return false;
		}
		if(Dd('v1').value.indexOf('|') == -1) {
			alert(Dd('n1').value+'至少需要两个属性');
			Dd('v1').focus();
			return false;
		}
	}
	if(Dd('v2').value) {
		if(!Dd('n2').value) {
			alert('请填写属性名称');
			Dd('n2').focus();
			return false;
		}
		if(Dd('v2').value.indexOf('|') == -1) {
			alert(Dd('n2').value+'至少需要两个属性');
			Dd('v2').focus();
			return false;
		}
	}
	if(Dd('v3').value) {
		if(!Dd('n3').value) {
			alert('请填写属性名称');
			Dd('n3').focus();
			return false;
		}
		if(Dd('v3').value.indexOf('|') == -1) {
			alert(Dd('n3').value+'至少需要两个属性');
			Dd('v3').focus();
			return false;
		}
	}
	if(Dd('n1').value && (Dd('n1').value == Dd('n2').value || Dd('n1').value == Dd('n3').value)) {
		alert('属性名称不能重复');
		return false;
	}
	if(Dd('n2').value && (Dd('n2').value == Dd('n1').value || Dd('n2').value == Dd('n3').value)) {
		alert('属性名称不能重复');
		return false;
	}
	if(Dd('n3').value && (Dd('n3').value == Dd('n1').value || Dd('n3').value == Dd('n2').value)) {
		alert('属性名称不能重复');
		return false;
	}
	if(Dd('express_name_1').value && (Dd('express_name_1').value == Dd('express_name_2').value || Dd('express_name_1').value == Dd('express_name_3').value)) {
		alert('快递名称不能重复');
		return false;
	}
	if(Dd('express_name_2').value && (Dd('express_name_2').value == Dd('express_name_1').value || Dd('express_name_2').value == Dd('express_name_3').value)) {
		alert('快递名称不能重复');
		return false;
	}
	if(Dd('express_name_3').value && (Dd('express_name_3').value == Dd('express_name_1').value || Dd('express_name_3').value == Dd('express_name_2').value)) {
		alert('快递名称不能重复');
		return false;
	}

	{if $FD}{fields_js()}{/if}
	{if $CP}{property_js()}{/if}
{if $need_password}
	f = 'password';
	l = Dd(f).value.length;
	if(l < 6) {
		Dmsg('请填写支付密码', f);
		return false;
	}
{/if}
{if $need_question}
	f = 'answer';
	l = Dd(f).value.length;
	if(l < 1) {
		Dmsg('请填写验证问题', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
{if $need_captcha}
	f = 'captcha';
	l = Dd(f).value;
	if(!is_captcha(l)) {
		Dmsg('请填写正确的验证码', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
	return Dstep();
}
function Dexpress(i, s) {
	if(Dd('express_'+i).value > 0) {
		var t1 = s.split('[');
		var t2 = t1[1].split(',');
		Dd('express_name_'+i).value = t2[0];
		Dd('fee_start_'+i).value = t2[1];
		Dd('fee_step_'+i).value = t2[2];
	} else {
		Dd('express_name_'+i).value = '';
		Dd('fee_start_'+i).value = '';
		Dd('fee_step_'+i).value = '';
	}
}
function Nexpress(i, s) {
	Dd('express_name_1').value = s;
	Dd('fee_start_1').value = i;
	Dd('fee_step_1').value = '0.00';
	$('#express_1').val(0);
	Dd('express_name_2').value = '';
	Dd('fee_start_2').value = '0.00';
	Dd('fee_step_2').value = '0.00';
	$('#express_2').val(0);
	Dd('express_name_3').value = '';
	Dd('fee_start_3').value = '0.00';
	Dd('fee_step_3').value = '0.00';
	$('#express_3').val(0);
}
function Dstep() {
	Dd('p_a_1').innerHTML=Dd('p_p_1').innerHTML=Dd('p_a_2').innerHTML=Dd('p_p_2').innerHTML=Dd('p_a_3').innerHTML=Dd('p_p_3').innerHTML='';
	var a1 = parseInt(Dd('a1').value);
	var p1 = parseFloat(Dd('p1').value);
	var a2 = parseInt(Dd('a2').value);
	var p2 = parseFloat(Dd('p2').value);
	var a3 = parseInt(Dd('a3').value);
	var p3 = parseFloat(Dd('p3').value);
	var u = Dd('unit').value;
	if(u.length < 1) Dd('unit').value = u = '件';
	var m = '{$DT[money_unit]}';
	if(!a1 || a1 < 1) {
		alert('起订量必须大于0');
		Dd('a1').value = '1';
		Dd('a1').focus();
		return false;
	}
	if(!p1 || p1 < 0.1) {
		alert('请填写商品价格');
		Dd('p1').value = '';
		Dd('p1').focus();
		return false;
	}
	Dd('p_a_1').innerHTML = a1+u+'以上';
	Dd('p_p_1').innerHTML = p1+m+'/'+u;
	if(a2 > 1 && p2 > 0.01) {
		if(a2 <= a1) {
			alert('数量必须大于'+a1);
			Dd('a2').value = '';
			Dd('a2').focus();
			return false;
		}
		if(p2 >= p1) {
			alert('价格必须小于'+p1);
			Dd('p2').value = '';
			Dd('p2').focus();
			return false;
		}
		Dd('p_a_1').innerHTML = a1+'-'+a2+u;
		Dd('p_p_1').innerHTML = p1+m+'/'+u;
		Dd('p_a_2').innerHTML = '>'+a2+u;
		Dd('p_p_2').innerHTML = p2+m+'/'+u;
	}
	if(a3 > 1 && p3 > 0.01) {
		if(a3 <= a2) {
			alert('数量必须大于'+a2);
			Dd('a3').value = '';
			Dd('a3').focus();
			return false;
		}
		if(p3 >= p2) {
			alert('价格必须小于'+p2);
			Dd('p3').value = '';
			Dd('p3').focus();
			return false;
		}
		Dd('p_a_2').innerHTML = (a2+1)+'-'+a3+u;
		Dd('p_p_2').innerHTML = p2+m+'/'+u;
		Dd('p_a_3').innerHTML = '>'+a3+u;
		Dd('p_p_3').innerHTML = p3+m+'/'+u;
	}
	return true;
}
var destoon_oauth = '{$EXT[oauth]}';
</script>
{/if}
{if $action=='add' && strlen($EXT[oauth]) > 1}{load('weibo.js')}{/if}
{template 'footer', 'member'}